﻿
namespace Mangosoft.DiceCopy.Infrastructure.Data.MainBoundedContext.UnitOfWork.Mapping {
    using System;
    using System.Collections.Generic;
    using System.Data.Entity.ModelConfiguration;
    using System.Linq;
    using System.Text;
    using Mangosoft.DiceCopy.Domain.MainBoundedContext.Aggregates.ResumeAgg;

    class ResumeEntityConfiguration : EntityTypeConfiguration<Resume> {
        public ResumeEntityConfiguration() {
            this.ToTable("dc_resume");
            this.HasKey(r => r.Id);

            // Resume -> Education's Navigation
            this.HasMany(r => r.Educations)
                .WithRequired()
                .HasForeignKey(edu => edu.ResumeId)
                .WillCascadeOnDelete(true);
        }
    }
}
